package com.example.tests;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

import org.testng.annotations.Test;

import com.example.fw.Folders;

public class TestFolderRemoval extends TestBase {
	@Test
	public void testFolderRemoval() {
		Integer folderNumber = 0;
		Folders oldFolders = app.getFolderHelper().getFolders();
		if (oldFolders.storedFolders.size() > folderNumber) {
			app.getFolderHelper().removeFolder(folderNumber);
			oldFolders.storedFolders.remove(folderNumber);
			Folders newFolders = app.getFolderHelper().getFolders();
			assertThat(newFolders,
					equalTo(oldFolders.withRemoved(oldFolders.storedFolders
							.get(folderNumber))));
		} else {
			System.out.println("!!! There isn't folder number " + folderNumber + " !!!");
		}
		
	}

}
